package edu.sctu.practice.class02.qiuyangyang.assign02;

/**
 * Created by Administrator on 2015/10/8 0008.
 */
public class Rational {
    double a, b;

    public Rational(double a, double b) {
        this.a = a;
        this.b = b;
    }

    public double setAdd() {
        return a + b;

    }

    public double setReduce() {
        return a - b;
    }

    public double setMultiply() {
        return a * b;
    }

    public double setDivide() {
        return a / b;
    }

    public static void main(String[] args) {
        Rational text = new Rational(9, 3);
        System.out.println("a+b=" + text.setAdd());
        System.out.println("a-b=" + text.setReduce());
        System.out.println("a*b=" + text.setMultiply());
        System.out.println("a/b=" + text.setDivide());
    }
}
